<!-- 章节 -->
<script setup>
import { Search } from '@element-plus/icons-vue'
import { ref } from 'vue'
import { useCourseStore } from '@/stores/index'
const courseStore = useCourseStore()

// 下拉框
const selectvalue = ref('')

// 输入框
const inputValue = ref('')
const serach = () => {
  console.log(inputValue.value)
}
</script>

<template>
  <el-card class="my-chapter">
    <div class="header">
      <el-select
        v-model="selectvalue"
        placeholder="班级"
        clearable
        style="width: 200px; margin-right: 20px"
      >
        <el-option
          v-for="item in courseStore.allClass"
          :key="item.classId"
          :label="item.classId"
          :value="item.classId"
        ></el-option>
      </el-select>
      <span class="all-set" style="margin-right: 20px; cursor: pointer">批量设置</span>
      <el-input
        v-model="inputValue"
        :suffix-icon="Search"
        class="input-header"
        placeholder="搜索"
        @keyup.enter="serach"
      />
    </div>
    <div class="demo-collapse">
      <el-collapse v-model="activeNames" @change="handleChange">
        <el-collapse-item title="实验连接数据库" name="1">
          <div>知识点:1.数据库概述 2数据库优点 3.数据库连接</div>
          <div class="home">
            <HomeWork
              style="line-height: 60px; position: relative; top: 21px; margin-right: 10px"
            ></HomeWork>
            <a href="https://www.examcoo.com/editor/do/exam/id/120557" target="_blank"
              >数据库平时练习</a
            >
          </div>
          <div class="home">
            <HomeWork
              style="line-height: 60px; position: relative; top: 21px; margin-right: 10px"
            ></HomeWork>
            <a href="https://www.examcoo.com/editor/do/exam/id/120531" target="_blank"
              >数据库基础练习</a
            >
          </div>
        </el-collapse-item>
        <el-collapse-item title="创建数据库并插入数据" name="2">
          <div>知识点:1.基本数据类型 2.插入数据</div>
          <div class="home">
            <HomeWork
              style="line-height: 60px; position: relative; top: 21px; margin-right: 10px"
            ></HomeWork>
            <a href="https://www.examcoo.com/editor/do/exam/id/120524" target="_blank"
              >数据库系统</a
            >
          </div>
          <div class="home">
            <HomeWork
              style="line-height: 60px; position: relative; top: 21px; margin-right: 10px"
            ></HomeWork>
            <a href="https://www.examcoo.com/editor/do/exam/id/120522" target="_blank">数据库</a>
          </div>
        </el-collapse-item>
        <el-collapse-item title="数据库的增删改查" name="3">
          <div>知识点:1.数据库的操作 2.数据表的操作 3.更新和删除数据</div>
        </el-collapse-item>
      </el-collapse>
    </div>
  </el-card>
</template>

<style lang="scss" scoped>
.my-chapter {
  margin-top: 6.25rem;

  // 头部
  .header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 1.25rem;
    height: 3.75rem;
    border-bottom: 1px solid #e2e2e2;

    .input-header {
      width: 200px;

      :deep(.el-input__wrapper) {
        border-radius: 50px;
      }
    }
  }

  // 平时练习
  .home {
    height: 60px;
    // border-bottom: 1px solid #ccc;
    display: flex;
    flex-direction: row;
    a {
      line-height: 60px;
      justify-items: center;
      align-items: center;
      text-decoration: none;
      color: black;
    }
    &:hover {
      background-color: #ebebeb;
      text-decoration: none;
      cursor: pointer;
    }
  }
}
</style>
